package com.hadoop.sort;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Partitioner;

public class GroupKeyPartitioner extends Partitioner<DateKey, IntWritable> {

	@Override
	public int getPartition(DateKey arg0, IntWritable arg1, int arg2) {
		int hash = arg0.getYear().hashCode();
		int partition = hash % arg2;
		return partition;
	}

}
